<template>
  <div v-if="show">
    <div v-if="tableCode === 'DWJBXX'">
      <tab-unit-base-info-form
        v-if="open_info_detail"
        :visible.sync="open_info_detail"
        :infoId="infoId"
        :edit="edit"
        @reload="onReload"
      />
    </div>
    <div v-if="tableCode === 'RYGM'">
      <tab-personnel-size-form
        v-if="open_info_detail"
        :visible.sync="open_info_detail"
        :infoId="infoId"
        :edit="edit"
        @reload="onReload"
      />
    </div>
    <div v-if="tableCode === 'KYTJ'">
      <tab-research-conditions-form
        v-if="open_info_detail"
        :visible.sync="open_info_detail"
        :infoId="infoId"
        :edit="edit"
        @reload="onReload"
      />
    </div>
    <div v-if="tableCode === 'JTYSYJKFJFZC'">
      <tab-research-and-development-expenditure-form
        v-if="open_info_detail"
        :visible.sync="open_info_detail"
        :infoId="infoId"
        :edit="edit"
        @reload="onReload"
      />
    </div>
    <div v-if="tableCode === 'JTYSKJXM'">
      <tab-technology-projec-form
        v-if="open_info_detail"
        :visible.sync="open_info_detail"
        :infoId="infoId"
        :edit="edit"
        @reload="onReload"
      />
    </div>
    <div v-if="tableCode === 'JTYSKJCG'">
      <tab-technological-achievements-form
        v-if="open_info_detail"
        :visible.sync="open_info_detail"
        :infoId="infoId"
        :edit="edit"
        @reload="onReload"
      />
    </div>
    <div v-if="tableCode === 'GJKJHZYJL'">
      <tab-cooperation-and-communication-form
        v-if="open_info_detail"
        :visible.sync="open_info_detail"
        :infoId="infoId"
        :edit="edit"
        @reload="onReload"
      />
    </div>
    <div v-if="tableCode === 'JTHYZDSYS'">
      <tab-key-laboratory-form
        v-if="open_info_detail"
        :visible.sync="open_info_detail"
        :infoId="infoId"
        :edit="edit"
        @reload="onReload"
      />
    </div>
    <div v-if="tableCode === 'BZHQK'">
      <tab-standardization-form
        v-if="open_info_detail"
        :visible.sync="open_info_detail"
        :infoId="infoId"
        :edit="edit"
        @reload="onReload"
      />
    </div>
  </div>
</template>

<script>
import TabUnitBaseInfoForm from './TabUnitBaseInfo/form.vue';
import TabPersonnelSizeForm from './TabPersonnelSize/form.vue';
import TabResearchConditionsForm from './TabResearchConditions/form.vue';
import TabResearchAndDevelopmentExpenditureForm from './TabResearchAndDevelopmentExpenditure/form.vue';
import TabTechnologyProjecForm from './TabTechnologyProjec/form.vue';
import TabTechnologicalAchievementsForm from './TabTechnologicalAchievements/form.vue';
import TabCooperationAndCommunicationForm from './TabCooperationAndCommunication/form.vue';
import TabKeyLaboratoryForm from './TabKeyLaboratory/form.vue';
import TabStandardizationForm from './TabStandardization/form.vue';

export default {
  name: 'TableForm',
  components: {
    TabUnitBaseInfoForm,
    TabPersonnelSizeForm,
    TabResearchConditionsForm,
    TabResearchAndDevelopmentExpenditureForm,
    TabTechnologyProjecForm,
    TabTechnologicalAchievementsForm,
    TabCooperationAndCommunicationForm,
    TabKeyLaboratoryForm,
    TabStandardizationForm
  },
  props: {
    tableCode: {
      type: String,
      require: true
    },
    edit: {
      type: Boolean,
      default: false
    },
    infoId: {
      type: Number,
      default: -1
    },
    show: {
      type: Boolean,
      default: true
    }
  },
  data() {
    return {
      open_info_detail: false,
    }
  },
  created() {
    this.open_info_detail = this.show
    console.log('table form render')
  },
  methods: {
    onReload() {
      this.$emit('reload', true)
    }
  }
}
</script>

<style lang="less" scoped>

</style>
